fix(input): 高負荷時の入力漏れを防ぐ - #343
Merged
Merged
Conversation
ensan-hcl
marked this pull request as ready for review
August 1, 2026 09:42
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
通常のキー入力、marked text、候補操作を
SegmentsManagerのローカル同期処理へ戻します。入力処理は 7ab7821 より前と同等の経路になり、ConverterServer は設定画面用途として残します。背景・原因
7ab7821 でキー入力処理が同期 XPC 経由になったことで、PC が高負荷のときや ConverterServer の起動・接続が遅延したときに応答が得られず、
IMKInputController.handleがfalseを返す経路が生じていました。この場合、IME が処理すべきキーイベントがホストアプリへフォールスルーし、入力した英字が marked text の先頭へ混入することがありました。タイムアウトを撤廃するだけでは、XPC の一時切断や再接続失敗時の経路が残るため解消できませんでした。
変更内容
InputState.event/handleClientActionで処理SegmentsManagerへ復帰InputState・SegmentsManager・ClientActionの同期処理をCoreのInputSessionへ切り出しNSEvent/IMKTextInput/ ウィンドウ操作へ結果を反映するアダプターに整理影響
高負荷時にもキーイベントがアプリへ意図せず漏れず、7ab7821 より前と同様の入力挙動になります。実機で問題が解消したことを確認済みです。
確認
xcodebuild -project azooKeyMac.xcodeproj -scheme azooKeyMac -configuration Debug -destination 'platform=macOS' build CODE_SIGNING_ALLOWED=NOswift test --package-path Core(58 tests passed)swiftlint lint --strict --no-cache Core/Sources/Core/InputUtils/InputSession.swift Core/Tests/CoreTests/InputUtilsTests/InputSessionTests.swift azooKeyMac/InputController/azooKeyMacInputController.swift azooKeyMac/InputController/ConverterServerClient.swiftgit diff --check